import axios from '@/fetch'


export function getMatter(data) {
  return axios({
    url: "/commodity/findall",
    headers: {'Content-Type': 'application/json'},
    method: "post",
    params:data
  })
}

export function addMatter(data) {
  return axios({
    url: "/commodity/save",
    headers: {'Content-Type': 'application/json'},
    method: "post",
    data: data
  })
}

export function delMatter(data) {
  return axios({
    url: "/commodity/delete",
    headers: {'Content-Type': 'application/json'},
    method: "post",
    params: data,
  })
}

export function upMatter(id, data) {
  return axios({
    url: "/commodity/update",
    headers: {'Content-Type': 'application/json'},
    method: "post",
    params: id,
    data: data
  })
}

export function getMatterid(id) {
  return axios({
    url: "/commodity/findone",
    headers: {'Content-Type': 'application/json'},
    method: "post",
    params: id,
  })
}

export function addcomment(data) {
  return axios({
    url: "/comment/save",
    headers: {'Content-Type': 'application/json'},
    method: "post",
    data: data,
  })
}

export function adddetails(id,data) {
  return axios({
    url: "/commodity/setdetail",
    headers: {'Content-Type': 'application/json'},
    method: "post",
    params: id,
    data: data,
  })
}

export function cs(data) {
  return axios({
    url: "/commodity/getdetail",
    headers: {'Content-Type': 'application/json'},
    method: "post",
    params: data,
  })
}

export function ckjd(data) {
  return axios({
    url: "/schedule/findbycommodityid",
    headers: {'Content-Type': 'application/json'},
    method: "post",
    params: data,
  })
}

export function smqueryid(data) {
  return axios({
    url: "/commodity/findbynumber",
    headers: {'Content-Type': 'application/json'},
    method: "post",
    params: data
  })
}
